<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="1000" indicator-color="white">
      <van-swipe-item v-for="item in arr" :key="item.id"
        ><img :src="$pre + item.img" alt=""
      /></van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { reqHomebanner } from "../../../http/http";
export default {
  data() {
    return {
      arr: [],
    };
  },
  mounted() {
    this.getBannerList();
  },
  methods: {
    async getBannerList() {
      let { data: res } = await reqHomebanner();
      if (res.code == 200) {
        this.arr = res.list;
      }
    },
  },
};
</script>

<style scoped>
img {
  width: 100%;
  height: 100%;
}
.my-swipe{
  height: 3.8rem;
}
</style>